package com.zwan.oam_rtc.controller;

import com.zwan.oam_rtc.service.RtcmsService;
import com.zwan.oam_rtc.utils.messages.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/license")
public class LicenseController {
    @Autowired
    RtcmsService rtcmsService;

    //获得license
    @RequestMapping(value="/getlicense",method= RequestMethod.POST)
    public String login(@RequestBody String req) {
        if(StringUtil.isEmpty(req))
            return "";
        String license = rtcmsService.getLicense(req);
        if(StringUtil.isEmpty(license))
            return "";
        return license;
    }
}
